package com.cn.pack.controller;

import com.cn.pack.feign.UserService;
import com.cn.pack.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(path = "/user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping(path = "/query", method = RequestMethod.POST)
    public User query(@RequestBody User user) {
        System.out.println("user = " + user.toString());
        User query = userService.query(user);
        System.out.println("query = " + query.toString());
        return query;
    }
}
